package courselection;

public class Student extends People {
/*  private int id;  // 编号
    private String name;    // 姓名
   private String sex;    // 性别
*/
	private String major;
    private Course selectCourse;    // 所选课程
    private Course dropcourse;
    // 空构造
    public Student() {
    }

    // 学生（编号、姓名、性别、所选课程）
    public Student(int id, String name, String sex,String major, Course selectCourse) {
        this.id = id;
        this.name = name;
        this.sex = sex;
        this.major=major;
        this.selectCourse = selectCourse;
    }

    // 打印学生信息
    public String toString() {
        return "\n学生信息：" +"\n"+ "学号：" + id+ "\n"+ "姓名：" + name +"\n" +"性别：" + sex +"\n"+ "专业："+major
                + "\n"+ "选课信息：" + (selectCourse != null ? selectCourse.toString() : "未选课");
    }

    // 为学生设置所选课程
    public void setSelectCourse(Course selectCourse) {
        this.selectCourse = selectCourse;
    }
    //public void setSelectCourse(Course selectCourse) {
    //	return course.name;
    //}
    public void dropCourse(Course dropcourse) {
    	this.dropcourse=null;
    	
    }
    // 下面是get、set方法
    /*public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }
	*/
    public Course getSelectCourse() {
        return selectCourse;
    }
    public Course dropCourse() {
    	return null;
    }
}
